<template>
  <div>
    <div v-for="item in periGoodsList" :key="item.id" class="div-list">
      <!-- 标题 -->
      <div>
        <h1>{{item.title}}</h1>
      </div>
      <!-- 商品列表 -->
      <div id="myList" class="myList">
        <ul>
          <li v-for="goods in item.goodsList" :key="item.product_id">
            <router-link target="_blank" :to="{ path: '/periGoods/details',  query: {periGoodsId:goods.id} }">
              <img width="100%" :src="goods.defImg" alt />
              <h2>{{goods.name}}</h2>
              <div v-if="goods.seckillPrice == null">
                <p>
                  <span>￥{{goods.price.toFixed(2)}}</span>
                </p>
              </div>
              <div v-else>
                <p>
                  <span>￥{{goods.seckillPrice.toFixed(2)}}</span>
                </p>
                <p>
                  <el-tag type="info">{{goods.seckillPercentage}}%</el-tag>
                  <span style="color: #99a9bf; font-size: 15px">
                    ￥{{goods.price.toFixed(2)}}
                  </span>
                </p>
              </div>
            </router-link>
          </li>
          <li id="more">
            <router-link :to="{ path: '/goods', query: {} }">
              浏览更多
              <i class="el-icon-d-arrow-right"></i>
            </router-link>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "MyPeriGoodsList",
  props: ["list", "isMore", "isDelete", "catId"],
  data() {
    return {
      periGoodsList: this.list,  //商品列表
    };
  },
}
</script>

<style scoped>
.div-list {
  margin-top: 10px;
}

.myList{
  margin-top: 10px;
}

.myList ul li {
  z-index: 1;
  float: left;
  width: 234px;
  height: 280px;
  padding: 10px 0;
  margin: 0 0 14.5px 11px;
  background-color: white;
  -webkit-transition: all 0.2s linear;
  transition: all 0.2s linear;
  position: relative;
}
.myList ul li:hover {
  z-index: 2;
  -webkit-box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  -webkit-transform: translate3d(0, -2px, 0);
  transform: translate3d(0, -2px, 0);
}
.myList ul li img {
  display: block;
  width: 180px;
  height: 160px;
  background: url(../assets/imgs/placeholder.png) no-repeat 50%;
  margin: 0 auto;
}
.myList ul li h2 {
  margin: 25px 10px 0;
  font-size: 15px;
  font-weight: 400;
  color: #333;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.myList ul li h3 {
  margin: 5px 10px;
  height: 18px;
  font-size: 12px;
  font-weight: 400;
  color: #b0b0b0;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.myList ul li p {
  margin: 10px 10px 10px;
  text-align: center;
  color: #ff6700;
}
.myList ul li p .del {
  margin-left: 0.5em;
  color: #b0b0b0;
  text-decoration: line-through;
}
.myList #more {
  text-align: center;
  line-height: 280px;
}
.myList #more a {
  font-size: 18px;
  color: #333;
}
.myList #more a:hover {
  color: #ff6700;
}
.myList ul li .delete {
  position: absolute;
  top: 10px;
  right: 10px;
  display: none;
}
.myList ul li:hover .delete {
  display: block
}
.myList ul li .delete:hover {
  color: #ff6700;
}
</style>